package action;

import org.hibernate.Session;
import org.hibernate.Transaction;

import com.opensymphony.xwork2.ActionSupport;

import util.HibernateSessionFactory;
import vo.Fang;

public class FangAction extends ActionSupport {
	private static final long serialVersionUID = 1L;
	Fang fang ;

	public String addFang(){
		Session session = HibernateSessionFactory.currentSession();
		Transaction ts = session.beginTransaction();
//		fang.setDongxi("五全,双人床，热水器");
//		fang.setJiage(100);
//		fang.setLouceng(4);
//		fang.setQu("香坊");
//		fang.setXiaoqu("幸福家园");
//		fang.setWeizhi("哈平路32号");
//		fang.setChaoxiang("南");
		session.save(fang);
		ts.commit();
		return "success";
	}

	public Fang getFang() {
		return fang;
	}

	public void setFang(Fang fang) {
		this.fang = fang;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}
}
